package pe.com.mowa.siscobsms.datos;


/*
 * conexion.java
 *
 * Created on 9 de marzo de 2009, 04:42 PM
 *
 * To change this template, choose Tools | Template Manager
 * and open the template in the editor.
 */


import java.io.IOException;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;
//import java.util.Properties;

//import javax.naming.Context;

/**
 *
 * @author E72420
 */

public class conexion {
    
    private boolean localDebug;     
  //  private Properties prop; 
    private Connection cn;

    private String schema;
    
    
    public  conexion() throws Exception {
   
   	//javax.naming.Context ctx = new javax.naming.InitialContext();

   	
   	
   	
   	
   	
   	
   	//javax.naming.Context env = (Context) ctx.lookup("java:comp/env");
   	
   	this.schema = "";//(String) env.lookup("schema");
   
     Class.forName ("org.postgresql.Driver");
     String address  = "jdbc:postgresql://localhost/SISCOBSMS";//(String) env.lookup("address");
     String user     = "postgres";//(String) env.lookup("user");
     String password = "pericles";//(String) env.lookup("password");
     cn = DriverManager.getConnection (address, user, password);
      
    }
    
    public Connection get_conection() throws IOException, ClassNotFoundException, SQLException 
    {
    
     return this.cn;
    }
    
    
    
     public String get_schema()
    {
    
     return this.schema;
    }
    
    public boolean get_local_debug()
    {
     return this.localDebug;
    
    }
    
}